package com.xncoding.aop.controller;

/*import com.xncoding.aop.service.Awithin.S10;
import com.xncoding.aop.service.Awithin.S9;*/
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.xncoding.aop.annotation.spel.OperationLogAnnotation;
import com.xncoding.aop.model.CompanyDTO;
import com.xncoding.aop.service.within.C2;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;


/**
 * Description:
 */
@RestController
public class User01Controller {
    @Resource
    C2 c2;

   /* @Resource
    S9 s9;
    @Resource
    S10 s10;*/

    @RequestMapping("/findAopTest00")
    public String findAopTest00( String content,  Integer i){
        System.out.println("findAopTest01");
        return "findAopTest";
    }

    @RequestMapping("/findAopTest01")
    public void findAopTest01( String content,  Integer i){
        System.out.println("findAopTest01");
    }

  /*  @RequestMapping("/serviceS9")
    public void serviceS9( ){
        s9.m1();

    }

    @RequestMapping("/serviceS10")
    public void serviceS10( ){
        s10.m1();
        s10.m2();
        s10.m3();
    }*/


    @OperationLogAnnotation(content = "#companyDTO.companyId == null ? '添加 名称：' + #companyDTO.companyName: '编辑  ID：' +  #companyDTO.companyId")
    @PostMapping("/saveCompany")
    public JSONObject saveCompany(@RequestBody CompanyDTO companyDTO, HttpServletRequest request){
        System.out.println("saveCompanysaveCompanysaveCompanysaveCompanysaveCompany");
        System.out.println(JSON.toJSONString(companyDTO));

        return new JSONObject();
    }


}
